package com.znzz.service.impl;

import com.znzz.dao.FilesDao;
import com.znzz.entity.Files;
import com.znzz.service.FilesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "fileService")
public class FilesServiceImpl implements FilesService {

    private FilesDao filesDao;

    @Autowired
    public FilesServiceImpl(FilesDao filesDao){
        this.filesDao=filesDao;
    }

    @Override
    public boolean saveFiles(Files files) {
        return filesDao.saveFiles(files);
    }

    @Override
    public List<Files> queryFiles() {
        return filesDao.queryFiles();
    }

    @Override
    public boolean deleteById(Integer id) {
        System.out.println("执行通过id删除文件");
        return filesDao.deleteById(id);
    }

    @Override
    public Files findFileById(Integer id) {

        return filesDao.findFileById(id);
    }

    @Override
    public boolean updateDownloadCount(Files file) {
        return filesDao.updateDownloadCount(file);
    }


}
